n,w=map(int,input().split())
hot=list(map(int,input().split()))
count=0
sum=0
for i in range(n):
    if hot[i]>=35:
        if (i+w)%7==4:
            count+=1
        else:
            sum+=1
    else:
        continue
print(sum,end=" ")
print(count)